package cc.jq1024.infrastructure.persistent.dao;

import cc.jq1024.infrastructure.persistent.po.RaffleActivityAccountPO;
import cc.jq1024.router.annotation.DBRouter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 抽奖活动账户表 Mapper 接口
 * </p>
 *
 * @author lijiaqiang@ljq1024.cc
 * @since 2024-04-22
 */
@Mapper
public interface IRaffleActivityAccountDao extends BaseMapper<RaffleActivityAccountPO> {

    /** 更新用户账户 */
    int updateAccountQuota(RaffleActivityAccountPO raffleActivityAccount);

    /** 创建账户 */
    void insertOne(RaffleActivityAccountPO raffleActivityAccount);


    /** 通过用户ID查询 */
    @DBRouter
    RaffleActivityAccountPO queryActivityAccountByUserId(RaffleActivityAccountPO raffleActivityAccountReq);

    /** 更新账户额度 */
    int updateActivityAccountSubtractionQuota(RaffleActivityAccountPO raffleActivityAccount);

    /** 更新月额度总额度的镜像额度 */
    void updateActivityAccountMonthSurplusImageQuota(RaffleActivityAccountPO raffleActivityAccount);

    /** 更新日额度总额度的镜像额度 */
    void updateActivityAccountDaySurplusImageQuota(RaffleActivityAccountPO raffleActivityAccount);

    /** 查询账户信息 */
    RaffleActivityAccountPO queryAccountByUserId(RaffleActivityAccountPO raffleActivityAccount);
}
